!OSLib/docs/Unix_Build

This file records the changes to the OSLib development environment to allow
building under Unix/Linux, as well as retaining the ability to build under RISC
OS.

In general, I have applied the following rules:
i.	All file names with ,xxx extensions are the RISC OS versions; this is in
	particular important for Makefiles, TaskObey, and Obey files.
ii	The GNU/Linux make files are called GNUmakefile.
iii	A third category of make, obey, and taskobey files, intended to be used
	under RISC OS, but using the unix-type directory structre are entitled
	UMakefile, etc.


1. Tools
========
The tools hierarchy has been changed, bringing support/* and oslib/* up from
within defmod to the top of this hierarchy. This makes it a central resource for
all tools. Within Tools/oslib, a new subdirectory, Tools/oslib/unix now contains
Dave Ruck's platform-independent port of OSLib. However, the tools/oslib headers
conditionally either declare these functions, or declare a _swix interface when
running under RISC OS.

Acknowledgements are due to Dave and Stewart for their contributions, without
which the task would have been much harder.

1.0 OSLib Unix Port
-------------------
Dave Ruck kindliy made available his port of OSLib functions. Using this as a base,
and adding to it, the tools can now all be built under UNIX. A number of functions were added, some existing functions were enhanced, and error handling was improved.
Changes include:
	made all functions which can provide an output test the	pointer for NULL
	implemented osfile_load_stamped_no_path, osfile_delete
	implemented osgbpb_dir_entries_info
	implemented os_writen, os_write0, os_new_line, os_readc, os_writec,
		os_pretty_print
	implemented osargs_ensurew

1.1 DefMod
----------
(a) DefMod is built from defmod/Build_GNU, and defmod/Build_RISCOS, depending on
the environment. The final target is copied to oslib/bin as before. DefMod's
makefile has been changed to allow for the relocations of it and the support
directories.

(b) sources/objasm.c has been changed to allow the chosen assembler to be passed in
as a macro. The syntax for gcc 'as' is different to that of armasm and objasm, so
this is special-cased. In verbose mode the assemler command is printed to stdout.

(c) In order to accommodate an AS feature, branches targeting local labels have
an "a" option (all macro levels) included. This is fully OBJASM compatible.

(d) The GETs in the Hdr files are now of the form "GET oslib/File.Hdr", in line with
the head revision of OSLib. This should be compatible with any assembler used with OSLib.

(e) The definition of a char constant is now the same as for any other byte const,
i.e. the :CHR: operator has been dropped, as this had no useful effect, and caused
problems for AS.

(f) Structures, such as OS_DateAndTime, which is defined as:
   OS_DateAndTime    = [5] .Byte "System date and time",
was being translated in assembler headers to:
   OS_DateAndTime	#	5*Byte
which is entirely legal.

However, this precludes other structures from being derived from it, e.g.
  FileSwitch_InfoWords_date_and_time #       OS_DateAndTime
is faulted by GNU AS, although objasm (incorrectly, IMHO) accepts it.

The solution was to modify DefMod sources/hdr.c to always equate the size of the
structure to the symbol, i.e.
                                ^       0
                                #       5*Byte
   OS_DateAndTime               *       @

This change only affects the assembler headers, should be fully backward compatible,
and compatible with all assemblers.

1.2 StripDepends
----------------
StripDepends is not required to build OSLib under UNIX; hence it is not
ported to the OSLib build.

1.3 bison
---------
Bison is considered a standard UNIX tool, and the version supplied with
the OSLib distribution is RISC OS only. There was no need to port it back to UNIX.

1.4 rm
------
rm is a standard GNU tool, and is therefore not required for the UNIX OSLib
build. However, whilst it (or a version of it) is probably in everybody's RISC
OS library directory, it is small, and is part of Jonathan's original build kit.
There was no need to port it back to UNIX.

1.5 ReduceAOF
-------------
It is supposed to remove wastage in the AOF files, reducing their size
considerably. One of RS's little jokes; the code was badly obfuscated.
Despite requests, he refused to supply anything maintainable.
Anyway, I've unpicked it, no more. Fortunately, nothing other than a new
makefile was necessary for the port.

I have added a verbose switch "-v" to the command line which causes the
current file name to be printed to stdout.

1.6 BindHelp
------------
Needed a bit more work. This was mainly in the Tools/support and Tools/oslib
hierarchy, and the directory separator character needed changing
 	In Tools/support
		added kernel.h from Stewart's DefMod.
		added swis.h from Stewart's DefMod.

1.7 IndexHelp
-------------
Only needed a makefile.


2. OSLib
========

A completely new set of makefiles, specifically for GNU build has been created.
The build directory structure uses the UNIX convention rather than the RISC OS
one. No changes were required for the SWI definitions.

3. OSLibSupport
===============
Only required to build, not execute, under UNIX. New GNUmakefiles were written.
